package com.bean;

public class PageBean {
	
	static int pageNum=10; //分页数，每页显示10条
	
	private int currentPage; //当前页
	
	private int startIndex; //开始索引
	
	private int endIndex; //结束索引
	
	private int totalPage;  //总页数
	
	private int records;//总记录数
	
	private int g_id;
	
	private int bs_id;
	
	public int getBs_id() {
		return bs_id;
	}

	public void setBs_id(int bs_id) {
		this.bs_id = bs_id;
	}

	public int getG_id() {
		return g_id;
	}

	public void setG_id(int g_id) {
		this.g_id = g_id;
	}

	public int getEndIndex() {
		return endIndex;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public static int getPageNum() {
		return pageNum;
	}

	public static void setPageNum(int pageNum) {
		PageBean.pageNum = pageNum;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		//计算开始索引
		this.startIndex=(currentPage-1)*pageNum;
		//计算结束索引
		this.endIndex=currentPage*pageNum;
		this.currentPage = currentPage;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public int getRecords() {
		return records;
	}

	public void setRecords(int records) {
		//计算总页数
		if(records%pageNum==0){
			this.totalPage=records/pageNum;
		}else{
			this.totalPage=records/pageNum+1;
		}
		
		this.records = records;
	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	
	

}
